package com.walleipt;

import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.io.LineNumberReader;

import org.apache.commons.lang.StringUtils;

import com.walle.ak47.commons.utils.IOUtils;

public class main {

	public static void main(String[] args) {
		
		LineNumberReader reader = null ;
		try
		{
			String encoding = "UTF-8" ;
			String filename = "C:/Users/admin/Desktop/booking-internal_20161208113118.txt" ;
			reader = new LineNumberReader( new InputStreamReader( new FileInputStream( filename ), encoding ) ) ;

			String line = null ;
			while( (line=reader.readLine()) != null )
			{
				line = line.trim() ;
				if ( line.indexOf("取消订单回退优惠券") > 0 )
				{
					System.err.println( StringUtils.substring(line, line.indexOf("{\"couponId\"")) );
				}
			}
		  
		}
		catch( Throwable err )
		{
			err.printStackTrace();
		}
		finally
		{
			if( reader != null )
			{
				IOUtils.closeQuietly( reader ) ;
			}
		}
		
	}

}
